<!-- Copyright (c) Microsoft Corporation.  All rights reserved. -->

<controls:UserControl x:Class="Microsoft.WindowsAPICodePack.Controls.WindowsPresentationFoundation.CommandLink"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:controls="clr-namespace:System.Windows.Controls;assembly=PresentationFramework"
             xmlns:data="clr-namespace:System.Windows.Data;assembly=PresentationFramework"
             xmlns:windows="clr-namespace:System.Windows;assembly=PresentationFramework"
                      xmlns:effects="clr-namespace:System.Windows.Media.Effects;assembly=PresentationCore"
                      xmlns:shapes="clr-namespace:System.Windows.Shapes;assembly=PresentationFramework"
                      xmlns:media="clr-namespace:System.Windows.Media;assembly=PresentationCore"
                      xmlns:animation="clr-namespace:System.Windows.Media.Animation;assembly=PresentationFramework"
                      xmlns:animation1="clr-namespace:System.Windows.Media.Animation;assembly=PresentationCore"
                      Width="325"
    Height="63"
    HorizontalAlignment="Left"
    Margin="0,0,0,12"
    >
  <controls:UserControl.Resources>
    <windows:Style x:Key="Style" TargetType="{x:Type controls:RadioButton}">
      <windows:Setter Property="Template">
        <windows:Setter.Value>
          <controls:ControlTemplate TargetType="{x:Type controls:RadioButton}">
            <controls:Canvas>
              <controls:Canvas Name="Normal" Opacity="1">
                <controls:StackPanel Margin="7,7,7,7" Orientation="Horizontal">
                  <controls:Image Source="{data:Binding Path=Icon}" />
                  <controls:StackPanel Margin="6,0,0,10">
                    <controls:TextBlock FontFamily="Segoe" FontSize="16" Foreground="#282671" Text="{data:Binding Path=Link}">
                      <controls:TextBlock.BitmapEffect>
                        <effects:OuterGlowBitmapEffect GlowColor="White" GlowSize="5"/>
                      </controls:TextBlock.BitmapEffect>
                    </controls:TextBlock>
                    <controls:TextBlock FontFamily="Segoe" FontSize="10" Foreground="#282671" Text="{data:Binding Path=Note}">
                      <controls:TextBlock.BitmapEffect>
                        <effects:OuterGlowBitmapEffect GlowColor="White" GlowSize="5"/>
                      </controls:TextBlock.BitmapEffect>
                    </controls:TextBlock>
                  </controls:StackPanel>
                </controls:StackPanel>
              </controls:Canvas>
              <controls:Canvas Opacity="0" Name="Selected">
                <shapes:Rectangle  Stroke="Cyan" Fill="White" RadiusX="2" RadiusY ="2" Width="520" Height="63"/>
                <controls:StackPanel Margin="7,7,7,7" Orientation="Horizontal">
                  <controls:Image Source="{data:Binding Path=Icon}" />
                  <controls:StackPanel Margin="6,0,0,10">
                    <controls:TextBlock FontFamily="Segoe" FontSize="16" Foreground="#5380f6" Text="{data:Binding Path=Link}">
                      <controls:TextBlock.BitmapEffect>
                        <effects:OuterGlowBitmapEffect GlowColor="White" GlowSize="5"/>
                      </controls:TextBlock.BitmapEffect>
                    </controls:TextBlock>
                    <controls:TextBlock FontFamily="Segoe" FontSize="10" Foreground="#5380f6" Text="{data:Binding Path=Note}">
                      <controls:TextBlock.BitmapEffect>
                        <effects:OuterGlowBitmapEffect GlowColor="White" GlowSize="5"/>
                      </controls:TextBlock.BitmapEffect>
                    </controls:TextBlock>
                  </controls:StackPanel>
                </controls:StackPanel>
              </controls:Canvas>
              <controls:Canvas Opacity="0" Name="Hover">
                <shapes:Rectangle  Stroke="Gray"  RadiusX="2" RadiusY ="2" Width="520" Height="63">
                  <shapes:Rectangle.Fill>
                    <media:LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                      <media:LinearGradientBrush.GradientStops>
                        <media:GradientStop Color="White"  Offset="0"/>
                        <media:GradientStop Color="#F9F9F9" Offset="0.30"/>
                      </media:LinearGradientBrush.GradientStops>
                    </media:LinearGradientBrush>
                  </shapes:Rectangle.Fill>
                </shapes:Rectangle>
                <controls:StackPanel Margin="7,7,7,7" Orientation="Horizontal">
                  <controls:Image Source="{data:Binding Path=Icon}" />
                  <controls:StackPanel Margin="6,0,0,10">
                    <controls:TextBlock FontFamily="Segoe" FontSize="16" Foreground="#5380f6" Text="{data:Binding Path=Link}">
                      <controls:TextBlock.BitmapEffect>
                        <effects:OuterGlowBitmapEffect GlowColor="White" GlowSize="5"/>
                      </controls:TextBlock.BitmapEffect>
                    </controls:TextBlock>
                    <controls:TextBlock FontFamily="Segoe" FontSize="10" Foreground="#5380f6" Text="{data:Binding Path=Note}">
                      <controls:TextBlock.BitmapEffect>
                        <effects:OuterGlowBitmapEffect GlowColor="White" GlowSize="5"/>
                      </controls:TextBlock.BitmapEffect>
                    </controls:TextBlock>
                  </controls:StackPanel>
                </controls:StackPanel>
              </controls:Canvas>
              <controls:Canvas Opacity="0" Name="Pressed">
                <shapes:Rectangle  Stroke="#6868a9"  RadiusX="2" RadiusY ="2" Width="520" Height="63">
                  <shapes:Rectangle.Fill>
                    <media:LinearGradientBrush StartPoint="0,0.25" EndPoint="1,0.75">
                      <media:LinearGradientBrush.GradientStops>
                        <media:GradientStop Color="#93b9db"  Offset="0"/>
                        <media:GradientStop Color="#ebf6fa" Offset="0.50"/>
                        <media:GradientStop Color="#93b9db" Offset="1"/>
                      </media:LinearGradientBrush.GradientStops>
                    </media:LinearGradientBrush>
                  </shapes:Rectangle.Fill>
                  <shapes:Rectangle.BitmapEffect>
                    <effects:OuterGlowBitmapEffect GlowColor="LightGray"  GlowSize="3"/>
                  </shapes:Rectangle.BitmapEffect>
                </shapes:Rectangle>
                <controls:StackPanel Margin="7,7,7,7" Orientation="Horizontal">
                  <controls:Image Source="{data:Binding Path=Icon}" />
                  <controls:StackPanel Margin="6,0,0,10">
                    <controls:TextBlock FontFamily="Segoe" FontSize="16" Foreground="#294073" Text="{data:Binding Path=Link}">
                      <controls:TextBlock.BitmapEffect>
                        <effects:OuterGlowBitmapEffect GlowColor="White" GlowSize="5"/>
                      </controls:TextBlock.BitmapEffect>
                    </controls:TextBlock>
                    <controls:TextBlock FontFamily="Segoe" FontSize="10" Foreground="#294073" Text="{data:Binding Path=Note}">
                      <controls:TextBlock.BitmapEffect>
                        <effects:OuterGlowBitmapEffect GlowColor="White" GlowSize="5"/>
                      </controls:TextBlock.BitmapEffect>
                    </controls:TextBlock>
                  </controls:StackPanel>
                </controls:StackPanel>
              </controls:Canvas>
            </controls:Canvas>
            <controls:ControlTemplate.Triggers>
              <windows:DataTrigger Value="True" Binding="{data:Binding Path=IsChecked, RelativeSource={data:RelativeSource Self}}">
                <windows:DataTrigger.EnterActions>
                  <animation:BeginStoryboard>
                    <animation:Storyboard animation:Storyboard.TargetName="Selected">
                      <animation1:DoubleAnimation AccelerationRatio="0.2" DecelerationRatio="0.3" From="0.3" To="0.7" Duration="0:0:2" AutoReverse="True" RepeatBehavior="Forever"/>
                    </animation:Storyboard>
                  </animation:BeginStoryboard>
                </windows:DataTrigger.EnterActions>
                <windows:DataTrigger.ExitActions>
                  <animation:BeginStoryboard>
                    <animation:Storyboard animation:Storyboard.TargetName="Selected">
                      <animation1:DoubleAnimation To="0" Duration="0:0:1" />
                    </animation:Storyboard>
                  </animation:BeginStoryboard>
                </windows:DataTrigger.ExitActions>
              </windows:DataTrigger>
              <windows:EventTrigger RoutedEvent="controls:Button.MouseEnter">
                <windows:EventTrigger.Actions>
                  <animation:BeginStoryboard>
                    <animation:Storyboard animation:Storyboard.TargetName="Hover">
                      <animation1:DoubleAnimation To="1" Duration="0:0:0.2"/>
                    </animation:Storyboard>
                  </animation:BeginStoryboard>
                </windows:EventTrigger.Actions>
              </windows:EventTrigger>
              <windows:EventTrigger RoutedEvent="controls:Button.MouseLeave">
                <windows:EventTrigger.Actions>
                  <animation:BeginStoryboard>
                    <animation:Storyboard animation:Storyboard.TargetName="Hover">
                      <animation1:DoubleAnimation To="0" Duration="0:0:0.5"/>
                    </animation:Storyboard>
                  </animation:BeginStoryboard>
                </windows:EventTrigger.Actions>
              </windows:EventTrigger>
              <windows:EventTrigger RoutedEvent="controls:Button.PreviewMouseLeftButtonDown">
                <windows:EventTrigger.Actions>
                  <animation:BeginStoryboard>
                    <animation:Storyboard animation:Storyboard.TargetName="Pressed">
                      <animation1:DoubleAnimation To="1" Duration="0:0:0.2"/>
                    </animation:Storyboard>
                  </animation:BeginStoryboard>
                </windows:EventTrigger.Actions>
              </windows:EventTrigger>
              <windows:EventTrigger RoutedEvent="controls:Button.PreviewMouseLeftButtonUp">
                <windows:EventTrigger.Actions>
                  <animation:BeginStoryboard>
                    <animation:Storyboard animation:Storyboard.TargetName="Pressed">
                      <animation1:DoubleAnimation To="0" Duration="0:0:0.5"/>
                    </animation:Storyboard>
                  </animation:BeginStoryboard>
                </windows:EventTrigger.Actions>
              </windows:EventTrigger>
            </controls:ControlTemplate.Triggers>
          </controls:ControlTemplate>
        </windows:Setter.Value>
      </windows:Setter>
    </windows:Style>
  </controls:UserControl.Resources>
  <controls:RadioButton GroupName="commandLinkGroup" Name="button"/>
</controls:UserControl>
